﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="Defect_Tracking_System.Models" %>
<% if(Request.IsAuthenticated){ %>
<% 
    //Account Acc = AccountManagement.GetInstance().GetUserByUserName(Page.User.Identity.Name);   
    String Controller = ViewContext.RouteData.Values["controller"].ToString().ToLower();
    String Action = ViewContext.RouteData.Values["action"].ToString().ToLower();
    String TypeViewDefect = "";
    if (ViewContext.RouteData.Values.ContainsKey("type"))
    {
        TypeViewDefect = ViewContext.RouteData.Values["type"].ToString();
    }
%>

<!--  start nav-outer-repeat................................................................................................. START -->
<div class="nav-outer-repeat"> 
<!--  start nav-outer -->
<div class="nav-outer"> 

		<!-- start nav-right -->
		<div id="nav-right">
			<div class="nav-divider">&nbsp;</div>
			<div class="showhide-account"><img src="/Content/images/shared/nav/nav_myaccount.gif" width="93" height="14" alt="" /></div>
			<div class="nav-divider">&nbsp;</div>
			<a href="/Account/LogOff" id="logout"><img src="/Content/images/shared/nav/nav_logout.gif" width="64" height="14" alt="" /></a>
			<div class="clear">&nbsp;</div>
		
			<!--  start account-content -->	
			<div class="account-content">
			<div class="account-drop-inner">
                <%if(!Page.User.IsInRole("System Admin")){ %>
				<a href="/Account/Details?UserName=<%= Page.User.Identity.Name %>" id="acc-settings">My Profile</a>
				<div class="clear">&nbsp;</div>              
				<div class="acc-line">&nbsp;</div>
				<a href="/Account/EmailNotificationSettings?ReturnUrl=<%= Request.Url.ToString() %>" id="acc-emailnotify">Email Notification</a>
                <div class="clear">&nbsp;</div>
                <%} %>
				<div class="acc-line">&nbsp;</div>
				<a href="/Account/ChangePassword" id="acc-changepass">Change Password</a>
			</div>
			</div>
			<!--  end account-content -->
		
		</div>
		<!-- end nav-right -->


		<!--  start nav -->
		<div class="nav">
		<div class="table">
            <% if (Page.User.IsInRole("System Admin")) { %>
            <% if (Controller == "group") { %>
            <ul class="current">
            <%} else { %>
            <ul class="select">
            <%} %>
                <li><a href="/Group"><b>Group</b><!--[if IE 7]><!--></a><!--<![endif]-->
                    <!--[if lte IE 6]><table><tr><td><![endif]-->
                    <% if (Controller == "group") { %>
                    <div class="select_sub show">
                    <%} else { %>
                    <div class="select_sub">
                    <%} %>
                        <ul class="sub">
                            
                            <% if (Action == "index" && Controller == "group") { %>
                            <li class="sub_show"><a href="/Group/Index">All Groups</a></li>
                            <%} else { %>
                            <li><a href="/Group/Index">All Groups</a></li>
                            <%} %>

                        </ul>
                    </div>
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
            </ul>

            <div class="nav-divider">&nbsp;</div>
            <%} %>

		    <% if (!Page.User.IsInRole("System Admin")) { %>
            <% if (Controller == "defect") { %>
            <ul class="current">
            <%} else { %>
            <ul class="select">
            <%} %>
                <li><a href="/Defect"><b>Defect</b><!--[if IE 7]><!--></a><!--<![endif]-->
                    <!--[if lte IE 6]><table><tr><td><![endif]-->
                    <% if (Controller == "defect") { %>
                    <div class="select_sub show">
                    <%} else { %>
                    <div class="select_sub">
                    <%} %>
                        <ul class="sub">
                            <% if (Action == "create" && Controller == "defect") { %>
                            <li class="sub_show"><a href="/Defect/Create">Add defect</a></li>
                            <%} else { %>
                            <li><a href="/Defect/Create">Add defect</a></li>
                            <%} %>
                            <% if (Action == "index" && Controller == "defect" && TypeViewDefect == "MyDefect") { %>
                            <li class="sub_show"><a href="/Defect/Index/MyDefect">My Defects</a></li>
                            <%} else { %>
                            <li><a href="/Defect/Index/MyDefect">My Defects</a></li>
                            <%} %>
                            <% if (Action == "index" && Controller == "defect" && TypeViewDefect != "MyDefect") { %>
                            <li class="sub_show"><a href="/Defect/Index/All">All Defects</a></li>
                            <%} else { %>
                            <li><a href="/Defect/Index/All">All Defects</a></li>
                            <%} %>
                            <li><a href="#nogo">New defects</a></li>
                            <li><a href="#nogo">Unassigned</a></li>
                            <li><a href="#nogo">Closed</a></li>
                        </ul>
                    </div>
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
            </ul>
            <div class="nav-divider">&nbsp;</div>
            <%} %>
		      
            <% if (!Page.User.IsInRole("System Admin")) { %>                
            <% if (Controller == "project") { %>
            <ul class="current">
            <%} else { %>
            <ul class="select">
            <%} %>
                <li><a href="/Project"><b>Project</b><!--[if IE 7]><!--></a><!--<![endif]-->
                <!--[if lte IE 6]><table><tr><td><![endif]-->
                    <% if (Controller == "project") { %>
                    <div class="select_sub show">
                    <%} else { %>
                    <div class="select_sub">
                    <%} %>
                        <ul class="sub">
                            <% if (Page.User.IsInRole("Group Admin")|| Page.User.IsInRole("Project Admin")) { %>
                                <% if (Action == "addproject" && Controller == "project") { %>
                                <li class="sub_show"><a href="/Project/AddProject">Add Project</a></li>
                                <%} else { %>
                                <li><a href="/Project/AddProject">Add Project</a></li>
                                <%} %>
                            <%} %>
                            <% if (Action == "index" && Controller == "project") { %>
                            <li class="sub_show"><a href="/Project/Index">Projects</a></li>
                            <%} else { %>
                            <li><a href="/Project/Index">Projects</a></li>
                            <%} %>
                        </ul>
                    </div>
                <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
            </ul>
            <div class="nav-divider">&nbsp;</div>
            <%} %>
		
            <% if (Page.User.IsInRole("Group Admin")) { %>
            <% if (Controller == "account") { %>
            <ul class="current">
            <%} else { %>
            <ul class="select">
            <%} %>
                <li><a href="/Account"><b>Account</b><!--[if IE 7]><!--></a><!--<![endif]-->
                <!--[if lte IE 6]><table><tr><td><![endif]-->
                    <% if (Controller == "account") { %>
                    <div class="select_sub show">
                    <%} else { %>
                    <div class="select_sub">
                    <%} %>
                        <ul class="sub">
                            <% if (Action == "add" && Controller == "account") { %>
                                <li class="sub_show"><a href="/Account/Add">Add User</a></li>
                                <%} else { %>
                                <li><a href="/Account/Add">Add User</a></li>
                            <%} %>
                            <% if (Action == "index" && Controller == "account") { %>
                                <li class="sub_show"><a href="/Account/Index">All Users</a></li>
                                <%} else { %>
                                <li><a href="/Account/Index">All Users</a></li>
                            <%} %>
                        </ul>
                    </div>
                <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
            </ul>
            <div class="nav-divider">&nbsp;</div>
            <%} %>
            
            <% if (Page.User.IsInRole("Group Admin")) { %>
            <% if (Controller == "client") { %>
            <ul class="current">
            <%} else { %>
            <ul class="select">
            <%} %>
                <li><a href="/Client"><b>Client</b><!--[if IE 7]><!--></a><!--<![endif]-->
                <!--[if lte IE 6]><table><tr><td><![endif]-->
                    <% if (Controller == "client") { %>
                    <div class="select_sub show">
                    <%} else { %>
                    <div class="select_sub">
                    <%} %>
                        <ul class="sub">
                            <% if (Action == "add" && Controller == "client") { %>
                                <li class="sub_show"><a href="/Client/Add">Add Client</a></li>
                                <%} else { %>
                                <li><a href="/Client/Add">Add Client</a></li>
                            <%} %>
                            <% if (Action == "index" && Controller == "client") { %>
                                <li class="sub_show"><a href="/Client/Index">All Clients</a></li>
                                <%} else { %>
                                <li><a href="/Client/Index">All Clients</a></li>
                            <%} %>         
                        </ul>
                    </div>
                <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
            </ul>
            <div class="nav-divider">&nbsp;</div>
		    <%} %>
            <% if (!Page.User.IsInRole("System Admin")) { %>
            <% if (Controller == "report") { %>
            <ul class="current">
            <%} else { %>
            <ul class="select">
            <%} %>
                <li><a href="/Report/OnLookups"><b>Report</b><!--[if IE 7]><!--></a><!--<![endif]-->
                <!--[if lte IE 6]><table><tr><td><![endif]-->
                    <% if (Controller == "report") { %>
                    <div class="select_sub show">
                    <%} else { %>
                    <div class="select_sub">
                    <%} %>
                        <ul class="sub">
                        <% if (!Page.User.IsInRole("System Admin")) { %>
                            <% if (Action == "onlookups" && Controller == "report") { %>
                                <li class="sub_show"><a href="/Report/OnLookups">On Lookups</a></li>
                                <%} else { %>
                                <li><a href="/Report/OnLookups">On Lookups</a></li>
                            <%} %>
                            <% if (Action == "onweek" && Controller == "report") { %>
                                <li class="sub_show"><a href="/Report/OnWeek">On Week</a></li>
                                <%} else { %>
                                <li><a href="/Report/OnWeek">On Week</a></li>
                            <%} %>
                            <% if (Action == "onmonth" && Controller == "report") { %>
                                <li class="sub_show"><a href="/Report/OnMonth">On Month</a></li>
                                <%} else { %>
                                <li><a href="/Report/OnMonth">On Month</a></li>
                            <%} %>
                            <% if (Action == "onyear" && Controller == "report") { %>
                                <li class="sub_show"><a href="/Report/OnYear">On Year</a></li>
                                <%} else { %>
                                <li><a href="/Report/OnYear">On Year</a></li>
                            <%} %>
                            <% if (Action == "customdate" && Controller == "report") { %>
                                <li class="sub_show"><a href="">Custom Date</a></li>
                                <%} else { %>
                                <li><a href="">Custom Date</a></li>
                            <%} %>
                            <% if (Page.User.IsInRole("Group Admin") || Page.User.IsInRole("Project Admin")) { %>
                                 <% if (Action == "ongroup" && Controller == "report") { %>
                                    <li class="sub_show"><a href="">On Group</a></li>
                                    <%} else { %>
                                    <li><a href="">On Report</a></li>
                                <%} %>
                            <%} %>
                        <%} %>
                        </ul>
                    </div>
                <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
                <%} %>
            </ul>

            <% if (Controller == "help")
               { %>
                <ul class="current">
            <% }
               else
               { %>
                <ul class="select">
            <% } %>
                <li><a href="/help"><b>Help</b></a>
                </li>
            </ul>
            <div class="clear"></div>
		</div>
        <div class="clear"></div>
        </div>
		<!--  start nav end -->

</div>
<!--  start nav-outer end -->
<div class="clear"></div>
</div>
<!--  start nav-outer-repeat................................................... END -->
<%} %>